package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface CustomerService {
	
//	查询没有关联定区的客户
	@Path("/nofixedareaidcustomer")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> findNoFixedAreaIdCustomers();
	
	
//	查询有关联定区的客户
	
	@Path("/hasfixedareaidcustomer/{fixedid}")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> findHasFixedAreaIdCustomer(
			@PathParam("fixedid") String fixedAreaId);
	
	
	
//	把客户与定区ID相关联
	@Path("/customertofixedarea")
	@PUT
	public void CustmoerToFixed(
//			这里有很多用户id,这里就可以吧这些用户id拼成字符串
			@QueryParam("customerIdStr") String CustomerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId
			);
	
	
	@Path("/customer")
	@POST
	@Consumes({"application/xml","application/json"})
	public void regist(Customer customer);
	
	
	@Path("/customer/telephone/{telephone}")
	@GET
	@Consumes({"application/xml","application/json"})
	public Customer findByTelephone(@PathParam("telephone")String telephone);
	
	
	@Path("/customer/updatetype/{telephone}")
	@GET
	public void updateType(@PathParam("telephone")String telephone);
	
	@Path("customer/login")
	@GET
	@Consumes({"application/xml","application/json"})
	public Customer login(@QueryParam("telephone")String telephone,@QueryParam("password")String password);
	
	@Path("/customer/findFixedAreaIdByAddress")
	@GET
	@Consumes({"application/xml","application/json"})
	public String findFixedAreaIdByAddress(@QueryParam("address") String address);
	
	
	
	
}
